[Dashboard] Link Workers to Actor Detail pages and handle Nil IDs#63795
[Dashboard] Link Workers to Actor Detail pages and handle Nil IDs#63795AyushKashyapII wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the worker row component to conditionally wrap the command line text in a link, pointing to either the specific actor page or the node page. The feedback suggests adding defensive checks to prevent runtime errors if the command line array is empty or undefined, and refactoring the conditional logic to reduce code duplication.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| <TableCell align="center"> | ||
| {coreWorker && | ||
| coreWorker.actorId && | ||
| coreWorker.actorId !== "ffffffffffffffffffffffffffffffffffffffff" && | ||
| coreWorker.actorId !== "ffffffffffffffffffffffffffffffff" ? ( | ||
| <Link component={RouterLink} to={`/actors/${coreWorker.actorId}`}> | ||
| {cmdline[0]} | ||
| </Link> | ||
| ) : ( | ||
| <Link component={RouterLink} to={`/cluster/nodes/${nodeId}`}> | ||
| {cmdline[0]} | ||
| </Link> | ||
| )} | ||
| </TableCell> |
There was a problem hiding this comment.
Correctness & Maintainability Issues
- Defensive Programming: If
cmdlineis undefined or empty, accessingcmdline[0]can cause a runtimeTypeErroror render an empty, unclickable link, which is a poor user experience. - Code Duplication: The
<Link component={RouterLink} ...>wrapper is duplicated for both the actor and fallback paths. We can simplify this by inlining the conditional logic for thetoprop and using a safe fallback for the link text.
<TableCell align="center">
<Link
component={RouterLink}
to={
coreWorker &&
coreWorker.actorId &&
coreWorker.actorId !== "ffffffffffffffffffffffffffffffffffffffff" &&
coreWorker.actorId !== "ffffffffffffffffffffffffffffffff"
? "/actors/" + coreWorker.actorId
: "/cluster/nodes/" + nodeId
}
>
{(cmdline && cmdline[0]) || "Worker (PID: " + pid + ")"}
</Link>
</TableCell>
723282b to
83e8142
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 83e8142. Configure here.
Signed-off-by: Ayush KAshyap <kashyap11ayush02@gmail.com>
83e8142 to
d39a808
Compare

Why are these changes needed?
This PR partially resolves #49342 (specifically addressing the first bullet point regarding Cluster view navigation).
The Problem: Currently, when viewing the Nodes table in the Cluster view, the worker process name is plain text. There is no quick way to jump to the details of a specific Actor running on that node without manually copy-pasting IDs into the search bar.
The Solution: This PR updates the
WorkerRowcomponent insideNodeRow.tsxso that the worker's process name (thecmdlinestring) now acts as a direct<Link>to the Actor Detail page (if the worker is hosting an Actor).Architectural Code Choices
During implementation, I had to account for several backend data structures exported by Ray:
worker.coreWorkerStatsis passed as an array to the frontend. The logic extractscoreWorkerStats[0]to safely access the ID.actorIdto null/undefined. Instead, it passes a "Nil" ID (a string of 32 or 40fs). I added an explicit check against thisffff...string to prevent linking users to non-existent actor pages./tasks/{taskId}page from this view. A worker process is long-lived and executes many tasks sequentially, so the backend does not expose a singletaskIdin the top-level worker stats./cluster/nodes/{nodeId}(the Node Detail page) to preserve navigation utility.Related issue number
Resolves #49342
Testing Instructions